class Person {
  var name : String = "lisi"
  var age : Int = 0
  def setPersonPropery(name : String, age : Int) : this.type = {
    this.name = name
    this.age = age
    this
  }

  def getPersonname : String = this.name
  def getPersonage : Int = this.age
}

class Student extends Person {
  var score : Int = 0
  var course : String = ""
  def setStudentPropery(course : String, score : Int) : this.type = {
    this.score = score
    this.course = course
    this
  }

  def getStudentCourese : String = this.course
  def getStudentScore : Int = this.score
}

object getPropery {
  def main(args : Array[String]) {
    val person = new Person
    val student = new Student
    student.setStudentPropery("数学",80).setPersonPropery("张三",20)
//    student.setStudentPropery("数学",80)
//    student.setPersonPropery("张三",20).setStudentPropery("数学",80)
    println(student.getStudentCourese)
    println(student.getStudentScore)
    println(student.getPersonage)
    println(student.getPersonname)
  }
}